//
//  LSAttendanceManagementCollectionViewCell.m
//  LaSaCivilAffairsDepartment
//
//  Created by 聂志康 on 2019/1/21.
//  Copyright © 2019 wpkj. All rights reserved.
//

#import "LSAttendanceManagementCollectionViewCell.h"

@implementation LSAttendanceManagementCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self.contentView addSubview:self.mainImageView];
        [self.contentView addSubview:self.mainLabel];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    WS
    [self.mainImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.contentView.mas_left);
        make.top.equalTo(weakSelf.contentView.mas_top);
        make.right.equalTo(weakSelf.contentView.mas_right);
        make.height.equalTo(@100);
    }];
    [self.mainLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.contentView.mas_left);
        make.right.equalTo(weakSelf.contentView.mas_right);
        make.top.equalTo(weakSelf.mainImageView.mas_bottom);
    }];
}

- (UIImageView *)mainImageView {
    if (!_mainImageView) {
        _mainImageView = [[UIImageView alloc] init];
        _mainImageView.contentMode = UIViewContentModeCenter;
    }
    return _mainImageView;
}

- (UILabel *)mainLabel {
    if (!_mainLabel) {
        _mainLabel = [[UILabel alloc] init];
        _mainLabel.font = [UIFont fontWithName:@"SourceHanSansCN-Regular" size:15];
        _mainLabel.textColor = hexColor(333333);
        _mainLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _mainLabel;
}

@end
